import { reqFindHeadCategory } from '@/api/home'
export default {
  namespaced: true,
  state: () => {
    return {
      list: [] // 分类的数据
    }
  },
  mutations: {
    setList(state, categoryList) {
      state.list = categoryList
    }
  },
  actions: {
    // 获取分类列表
    async categoryList({ commit }) {
      const res = await reqFindHeadCategory()
      commit('setList', res.result)
    }
  }
}
